#ifndef _LIB_CONFIG_API_H_
#define _LIB_CONFIG_API_H_

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the FDECODER_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// ASFDECODER_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef LIBCONFIG_EXPORTS
#define LIBCONFIG_API __declspec(dllexport)
#else
#define LIBCONFIG_API __declspec(dllimport)
#endif

#define APICALL WINAPI

typedef struct _tagMDVRConfigData
{
	int nLength;
	char cBuffer[1024];
}MDVRConfigData_S, *LPMDVRConfigData_S;

#ifdef __cplusplus
extern "C" {
#endif

typedef BOOL (CALLBACK* FUNTransparentConfig)(int nType, MDVRConfigData_S* lpInConfig, MDVRConfigData_S* lpOutConfig, void* pUsr);

//@ bInput: TRUE表示导入配置文件，会将szCfgFile传到设备上
//			FALSE表示导出配置文件，上层会从设备上获取szCfgFile，然后传给参数模块
//@ szCfgFile: 配置文件绝对路径，此文件名由参数模块生成
typedef BOOL (CALLBACK* FUNLoadConfigFile)(BOOL bInput, const char* szCfgFile, void* pUsr);

LIBCONFIG_API void APICALL MDVR_SetConfigFunction(FUNTransparentConfig pfnTransparentConfig, FUNLoadConfigFile pfnLoadConfigFile, void* pUsr);

/*---------------------------是否使用文件的方式------------------------------*/
// 默认为 False，
//	如果为TRUE，则上层会从设备下载整个配置文件，再将文件传到参数模块中
//	如果为FALSE，则为单个参数配置的模式
LIBCONFIG_API BOOL APICALL MDVR_IsLoadConfigFile();

/*---------------------------取得显示的宽度和高度------------------------------*/
LIBCONFIG_API int APICALL MDVR_GetDisplayWidth();
LIBCONFIG_API int APICALL MDVR_GetDisplayHeight();

/*---------------------------加载语言------------------------------*/
LIBCONFIG_API BOOL APICALL MDVR_SetLangPath(const char* szLangPath);

/*---------------------------在界面上显示参数数据和传回设置的参数数据------------------------------*/
LIBCONFIG_API HWND APICALL MDVR_DisplayConfig(HWND hParentWnd, const char* szFile);

/*---------------------------让DLL中的窗口可以响应PreTranslateMessage消息------------------------------*/
LIBCONFIG_API BOOL PASCAL MDVR_DllPreTranslateMessage(MSG *pMsg); 

LIBCONFIG_API BOOL PASCAL MDVR_ActivePage();

LIBCONFIG_API BOOL PASCAL MDVR_SaveLocalCfgFile(const char *szCfgFile,BOOL bFlag = FALSE);

/*---------------------------设置设备的通道数------------------------------*/
//则为单个参数配置的模式下有效
LIBCONFIG_API BOOL APICALL MDVR_SetDevChannelNum(unsigned int nChannelNum);

/****************************设置设备的类型***************************/
LIBCONFIG_API BOOL APICALL MDVR_SetDevType(int nDevType);

/***************************根据协议和厂家类型判断是否是此插件************/
/*
*nProtocol:为设备通讯协议
*nFactroy:厂家类型
*nExtra:额外的判断条件
*/
LIBCONFIG_API BOOL APICALL MDVR_IsEnableDll(int nProtocol, int nFactory, int nExtra);

#ifdef __cplusplus
};
#endif

#endif